
## frps



#docker rmi -f ubuntu:21.10
docker pull ubuntu:21.10
rm -rf /cardone/docker/images/ubuntu_21.10.tar
mkdir -p /cardone/docker/images
docker save ubuntu:21.10 > /cardone/docker/images/ubuntu_21.10.tar
#docker load < /cardone/docker/images/ubuntu_21.10.tar



mkdir -p /cardone/temps/frps

rm -rf /cardone/temps/frps
mkdir -p /cardone/temps/frps 
chmod -R 777 /cardone/temps/frps


(
cat << 'EOF'
FROM ubuntu:21.10

LABEL description=frps

WORKDIR /cardone/middlewares/frps

ADD frp_0.42.0_linux_amd64.tar.gz /cardone/middlewares/

RUN cp /cardone/middlewares/frp_0.42.0_linux_amd64/frps* /cardone/middlewares/frps

RUN rm -rf /cardone/middlewares/frp_0.42.0_linux_amd64

ENTRYPOINT ./frps -c ./frps.ini
EOF
) > /cardone/temps/frps/Dockerfile

cd /cardone/temps/frps

docker build -t frps:1.0.0 .

# docker tag frps:1.0.0 cardone:5000/frps:1.0.0
# docker push cardone:5000/frps:1.0.0




############################################################



docker stack rm cardone-frps

docker stack deploy -c /cardone/middlewares/frps/prod.yml cardone-frps

for i in {1..10}  
do  
sleep $i

docker stack ps cardone-frps

docker service ls
done

docker service logs cardone-frps_frps -f --tail 300


